A terminal device such as a mobile phone usually has a function to play a video, so that a user can play a video by using a video player installed in the terminal device.
A browser is used as an example. To meet a requirement for a user to watch a video and browse content on a web page at a same time, the browser is provided with a function of playing a video by using a floating window. The floating window that is used for playing a video is superposed on a top layer of a web page that is displayed in the browser. A display size of the floating window is less than a size of a screen, to ensure that a part of content in the web page on a lower layer of the floating window is not blocked by the floating window, so that while watching a video displayed in the floating window, the user can browse the web page at the same time. For example, by using the foregoing functions, the user can browse and select a to-be-played video in the web page while watching a video.
However, the foregoing floating window is usually displayed in a fixed location on the screen, causing great inconvenience to the user for watching other content that is displayed out of the floating window.